import { h } from 'preact';

// TODO: 默认样式引入

export default function Rect(props) {
  const { x, y, width, height } = props;
  const lfX = x - width / 2;
  const lfY = y - height / 2;
  const attrs = {
    // default
    x: 0, y: 0, width: 10, height: 10,
    cx: 0, cy: 0,
    fill: 'transparent', fillOpacity: 1,
    strokeWidth: '1px', stroke: '#000', strokeOpacity: 1,

    ...props,
    x: lfX,
    y: lfY
  };

  return (
    <rect {...attrs} />
  );
}
